using System;

namespace SubversionReports.Entities
{
    public class Path
    {
        #region fields

        private PathRevisionType revisionType;
        private string revisionPath;
        private string copyFromPath;
        private Nullable<int> copyFromRevision = null;

        #endregion

        #region accessors

        /// <summary>
        /// Gets or sets the type of the revision.
        /// </summary>
        /// <value>The type of the revision.</value>
        public PathRevisionType RevisionType
        {
            get { return revisionType; }
            set { revisionType = value; }
        }

        /// <summary>
        /// Gets or sets the revision path.
        /// </summary>
        /// <value>The revision path.</value>
        public string RevisionPath
        {
            get { return revisionPath; }
            set { revisionPath = value; }
        }

        /// <summary>
        /// Gets the change description.
        /// </summary>
        /// <value>The change description.</value>
        public string ChangeDescription
        {
            get { return string.Format("{0} {1}", revisionType, revisionPath); }
        }

        /// <summary>
        /// Gets or sets the copy from path.
        /// </summary>
        /// <value>The copy from path.</value>
        public string CopyFromPath
        {
            get { return copyFromPath; }
            set { copyFromPath = value; }
        }

        /// <summary>
        /// Gets or sets the copy from revision.
        /// </summary>
        /// <value>The copy from revision.</value>
        public int? CopyFromRevision
        {
            get { return copyFromRevision; }
            set { copyFromRevision = value; }
        }

        #endregion

        #region constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="Path"/> class.
        /// </summary>
        public Path () {}

        #endregion
    }

    public enum PathRevisionType
    {
        Unknown,
        Added,
        Deleted,
        Modified,
        Moved //Note that subversion does not report a state of moved. This is derived from a 
    }
}
